<template>
  <div class="parentbox">
    <Parent :parentData="parentData.parent" v-if="parentData.parent" />
    <div class="userinfo">
      <div class="info">
        <span class="author">火星网友1</span>
        <span class="date">2小时前</span>
      </div>
      <div class="huifu">回复</div>
    </div>
    <div class="content">
      {{ parentData.content }}
    </div>
  </div>
</template>

<script>
export default {
  //子组件（父评论）自己给自己添加的递归name！！
  name: "Parent",
  props: ["parentData"],
};
</script>

<style lang="less" scoped>
.parentbox {
  padding: 2px;
  margin: 5px;
  border: 1px solid #888;
  .userinfo {
    display: flex;
    align-items: center;
    .info {
      flex-grow: 1;
      margin-bottom: 6 / 360 * 100vw;
      .author {
        color: #333;
        font-size: 16 / 360 * 100vw;
      }
      .date {
        padding-left: 10 / 360 * 100vw;
        color: #888;
        font-size: 14 / 360 * 100vw;
      }
    }
    .huifu {
      color: #888;
      font-size: 14 / 360 * 100vw;
    }
  }
  .content {
    // margin-top: 3 / 360 * 100vw;
    padding: 10 / 360 * 100vw;
    color: #333;
    font-size: 16 / 360 * 100vw;
  }
}
</style>